package com.itoware;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;


@RestController
@SpringBootApplication
public class JenkinsdemoApplication {

	public static void main(String[] args) {
		SpringApplication.run(JenkinsdemoApplication.class, args);
	}

	@RequestMapping("/")
	String home() {	
		return "Hello World!";
	}
	@RequestMapping("/add")
	Integer add(Integer a, Integer b){
		return Calculator.add(a, b);
	}
	@PostMapping("/sub")
	Integer sub(Integer a, Integer b){
		return Calculator.sub(a, b);
	}
	@RequestMapping("/div")
	Integer div(Integer a, Integer b){
		return Calculator.div(a, b);
	}
	@RequestMapping("/calc")
	public ModelAndView userList(Model model){
		return new ModelAndView("index");
	}

}
